package com.myspace.controller.record;

import com.myspace.service.space.record.RemoveRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class RemoveRecordController {
    @Autowired
    private RemoveRecordService removeRecordService;

    @PostMapping("/myspace/unfollow/")
    public Map<String, String> removerecord(@RequestParam Map<String, String> data) {
        Integer followId = Integer.parseInt(data.get("follow_id"));
        Integer targetId = Integer.parseInt(data.get("target_id"));

        return removeRecordService.removerecord(followId, targetId);
    }
}
